function y = GetDataHDF(hdfFilePath,name)

% GetDataHDF(hdfFilePath,name) gets the variable NAME from the HDF file
% given by HDFFILEPATH, if it doesn't exist it will return a NaN.

try
    y = h5read(hdfFilePath,name);
catch
    warning(['Variable ' name ' doesn''t exist']);
    y = NaN;
end